#!/usr/local/bin/python
'''
Created on 2012/06/09

@author: Ryu Naeki
'''

import json
import cgi
import cgitb
cgitb.enable()

from DaoTweet import DaoTweet
from ImportTweet import ImportTweet

class GetTweet(object):
    '''
    classdocs
    '''

    def __init__(self):
        '''
        Constructor
        '''

    def run(self):
        dao = DaoTweet(DaoTweet.USERNAME, DaoTweet.PASSWORD, DaoTweet.DBNAME, DaoTweet.CHARSET)
        items = dao.get_tweet()
        return json.dumps(items)      
        
if __name__ == "__main__":
    it = ImportTweet()
    it.run()   
    
    gt = GetTweet()
    result = gt.run() 
    
    print "Content-Type: application/json; charset=utf-8"
    print # blank
    print result

    